home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / ControlStrip.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  7.9 KB  |  244 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        ControlStrip.h
  3.  
  4.      Contains:    Control Strip (for Powerbooks and Duos) Interfaces.
  5.  
  6.      Version:    Technology:    ControlStrip 1.4
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1992-1997 by Apple Computer, Inc. All rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __CONTROLSTRIP__
  19. #define __CONTROLSTRIP__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. #ifndef __MENUS__
  25. #include <Menus.h>
  26. #endif
  27. #ifndef __DIALOGS__
  28. #include <Dialogs.h>
  29. #endif
  30.  
  31.  
  32.  
  33. #if PRAGMA_ONCE
  34. #pragma once
  35. #endif
  36.  
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40.  
  41. #if PRAGMA_IMPORT
  42. #pragma import on
  43. #endif
  44.  
  45. #if PRAGMA_STRUCT_ALIGN
  46.     #pragma options align=mac68k
  47. #elif PRAGMA_STRUCT_PACKPUSH
  48.     #pragma pack(push, 2)
  49. #elif PRAGMA_STRUCT_PACK
  50.     #pragma pack(2)
  51. #endif
  52.  
  53. /*********************************************************************************************
  54.  
  55.     messages passed to the modules
  56.  
  57. *********************************************************************************************/
  58.  
  59. enum {
  60.     sdevInitModule                = 0,                            /* initialize the module*/
  61.     sdevCloseModule                = 1,                            /* clean up before being closed*/
  62.     sdevFeatures                = 2,                            /* return feature bits*/
  63.     sdevGetDisplayWidth            = 3,                            /* returns the width of the module's display*/
  64.     sdevPeriodicTickle            = 4,                            /* periodic tickle when nothing else is happening*/
  65.     sdevDrawStatus                = 5,                            /* update the interface in the Control Strip*/
  66.     sdevMouseClick                = 6,                            /* user clicked on the module's display area in the Control Strip*/
  67.     sdevSaveSettings            = 7,                            /* saved any changed settings in module's preferences file*/
  68.     sdevShowBalloonHelp            = 8                                /* puts up a help balloon, if the module has one to display*/
  69. };
  70.  
  71. /*********************************************************************************************
  72.  
  73.     Features supported by the module.  If a bit is set, it means that feature is supported.
  74.     All undefined bits are reserved for future use by Apple, and should be set to zero.
  75.  
  76. *********************************************************************************************/
  77.  
  78. enum {
  79.     sdevWantMouseClicks            = 0,                            /* notify the module of mouseDown events*/
  80.     sdevDontAutoTrack            = 1,                            /* call the module to do mouse tracking*/
  81.     sdevHasCustomHelp            = 2,                            /* module provides its own help messages*/
  82.     sdevKeepModuleLocked        = 3                                /* module needs to be locked in the heap*/
  83. };
  84.  
  85. /*********************************************************************************************
  86.  
  87.     Result values returned by the sdevPeriodicTickle and sdevIconMouseClick selectors.
  88.     If a bit is set, the module can request that a specific function is performed by
  89.     the Control Strip.  A result of zero will do nothing.  All undefined bits are reserved
  90.     for future use by Apple, and should be set to zero.
  91.  
  92. *********************************************************************************************/
  93.  
  94. enum {
  95.     sdevResizeDisplay            = 0,                            /* resize the module's display*/
  96.     sdevNeedToSave                = 1,                            /* need to save changed settings, when convenient*/
  97.     sdevHelpStateChange            = 2,                            /* need to update the help message because of a state change*/
  98.     sdevCloseNow                = 3                                /* close a module because it doesn't want to stay around*/
  99. };
  100.  
  101.  
  102. /*********************************************************************************************
  103.  
  104.     miscellaneous
  105.  
  106. *********************************************************************************************/
  107.  
  108. enum {
  109.     sdevFileType                = FOUR_CHAR_CODE('sdev')        /* module's file type*/
  110. };
  111.  
  112.  
  113. enum {
  114.     sdevMenuItemMark            = 0xA5                            /* ‘•’: ‘checkmark’ to use in popup menus*/
  115. };
  116.  
  117.  
  118. /*    direction values for SBDrawBarGraph*/
  119.  
  120.  
  121. enum {
  122.     BarGraphSlopeLeft            = -1,                            /* max end of sloping bar graph is on the left*/
  123.     BarGraphFlatRight            = 0,                            /* max end of flat bar graph is on the right*/
  124.     BarGraphSlopeRight            = 1                                /* max end of sloping bar graph is on the right*/
  125. };
  126.  
  127. /*********************************************************************************************
  128.  
  129.     utility routines to provide standard interface elements and support for common functions
  130.  
  131. *********************************************************************************************/
  132. EXTERN_API( Boolean )
  133. SBIsControlStripVisible            (void)                                                        TWOWORDINLINE(0x7000, 0xAAF2);
  134.  
  135. EXTERN_API( void )
  136. SBShowHideControlStrip            (Boolean                 showIt)                                THREEWORDINLINE(0x303C, 0x0101, 0xAAF2);
  137.  
  138. EXTERN_API( Boolean )
  139. SBSafeToAccessStartupDisk        (void)                                                        TWOWORDINLINE(0x7002, 0xAAF2);
  140.  
  141. EXTERN_API( short )
  142. SBOpenModuleResourceFile        (OSType                 fileCreator)                        THREEWORDINLINE(0x303C, 0x0203, 0xAAF2);
  143.  
  144. EXTERN_API( OSErr )
  145. SBLoadPreferences                (ConstStr255Param         prefsResourceName,
  146.                                  Handle *                preferences)                        THREEWORDINLINE(0x303C, 0x0404, 0xAAF2);
  147.  
  148. EXTERN_API( OSErr )
  149. SBSavePreferences                (ConstStr255Param         prefsResourceName,
  150.                                  Handle                 preferences)                        THREEWORDINLINE(0x303C, 0x0405, 0xAAF2);
  151.  
  152. EXTERN_API( void )
  153. SBGetDetachedIndString            (StringPtr                 theString,
  154.                                  Handle                 stringList,
  155.                                  short                     whichString)                        THREEWORDINLINE(0x303C, 0x0506, 0xAAF2);
  156.  
  157. EXTERN_API( OSErr )
  158. SBGetDetachIconSuite            (Handle *                theIconSuite,
  159.                                  short                     theResID,
  160.                                  unsigned long             selector)                            THREEWORDINLINE(0x303C, 0x0507, 0xAAF2);
  161.  
  162. EXTERN_API( short )
  163. SBTrackPopupMenu                (const Rect *            moduleRect,
  164.                                  MenuHandle             theMenu)                            THREEWORDINLINE(0x303C, 0x0408, 0xAAF2);
  165.  
  166. EXTERN_API( short )
  167. SBTrackSlider                    (const Rect *            moduleRect,
  168.                                  short                     ticksOnSlider,
  169.                                  short                     initialValue)                        THREEWORDINLINE(0x303C, 0x0409, 0xAAF2);
  170.  
  171. EXTERN_API( OSErr )
  172. SBShowHelpString                (const Rect *            moduleRect,
  173.                                  StringPtr                 helpString)                            THREEWORDINLINE(0x303C, 0x040A, 0xAAF2);
  174.  
  175. EXTERN_API( short )
  176. SBGetBarGraphWidth                (short                     barCount)                            THREEWORDINLINE(0x303C, 0x010B, 0xAAF2);
  177.  
  178. EXTERN_API( void )
  179. SBDrawBarGraph                    (short                     level,
  180.                                  short                     barCount,
  181.                                  short                     direction,
  182.                                  Point                     barGraphTopLeft)                    THREEWORDINLINE(0x303C, 0x050C, 0xAAF2);
  183.  
  184. EXTERN_API( void )
  185. SBModalDialogInContext            (ModalFilterUPP         filterProc,
  186.                                  short *                itemHit)                            THREEWORDINLINE(0x303C, 0x040D, 0xAAF2);
  187.  
  188. /* The following routines are available in Control Strip 1.2 and later. */
  189. EXTERN_API( OSErr )
  190. SBGetControlStripFontID            (short *                fontID)                                THREEWORDINLINE(0x303C, 0x020E, 0xAAF2);
  191.  
  192. EXTERN_API( OSErr )
  193. SBSetControlStripFontID            (short                     fontID)                                THREEWORDINLINE(0x303C, 0x010F, 0xAAF2);
  194.  
  195. EXTERN_API( OSErr )
  196. SBGetControlStripFontSize        (short *                fontSize)                            THREEWORDINLINE(0x303C, 0x0210, 0xAAF2);
  197.  
  198. EXTERN_API( OSErr )
  199. SBSetControlStripFontSize        (short                     fontSize)                            THREEWORDINLINE(0x303C, 0x0111, 0xAAF2);
  200.  
  201. EXTERN_API( OSErr )
  202. SBGetShowHideHotKey                (short *                modifiers,
  203.                                  unsigned char *        keyCode)                            THREEWORDINLINE(0x303C, 0x0412, 0xAAF2);
  204.  
  205. EXTERN_API( OSErr )
  206. SBSetShowHideHotKey                (short                     modifiers,
  207.                                  unsigned char             keyCode)                            THREEWORDINLINE(0x303C, 0x0213, 0xAAF2);
  208.  
  209. EXTERN_API( OSErr )
  210. SBIsShowHideHotKeyEnabled        (Boolean *                enabled)                            THREEWORDINLINE(0x303C, 0x0214, 0xAAF2);
  211.  
  212. EXTERN_API( OSErr )
  213. SBEnableShowHideHotKey            (Boolean                 enabled)                            THREEWORDINLINE(0x303C, 0x0115, 0xAAF2);
  214.  
  215. /* The following routines are available in Control Strip 1.4 and later. */
  216. EXTERN_API( short )
  217. SBHitTrackSlider                (const Rect *            moduleRect,
  218.                                  short                     ticksOnSlider,
  219.                                  short                     initialValue,
  220.                                  Boolean *                hit)                                THREEWORDINLINE(0x303C, 0x0616, 0xAAF2);
  221.  
  222.  
  223.  
  224. #if PRAGMA_STRUCT_ALIGN
  225.     #pragma options align=reset
  226. #elif PRAGMA_STRUCT_PACKPUSH
  227.     #pragma pack(pop)
  228. #elif PRAGMA_STRUCT_PACK
  229.     #pragma pack()
  230. #endif
  231.  
  232. #ifdef PRAGMA_IMPORT_OFF
  233. #pragma import off
  234. #elif PRAGMA_IMPORT
  235. #pragma import reset
  236. #endif
  237.  
  238. #ifdef __cplusplus
  239. }
  240. #endif
  241.  
  242. #endif /* __CONTROLSTRIP__ */
  243.  
  244.